Don't crash if the active_row reference has become invalid. (#157156,
authorMatthias Clasen <mclasen@redhat.com>
Wed, 3 Nov 2004 06:16:43 +0000 (06:16 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 3 Nov 2004 06:16:43 +0000 (06:16 +0000)
2004-11-03  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash
if the active_row reference has become invalid.  (#157156,
Christophe Fergeau)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c

index ea539e007a14c95dc78f1fed0ff08659ec640c26..61c83ea521978deadc76aecd2b8323e21fdacd74 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-11-03  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash 
+       if the active_row reference has become invalid.  (#157156,
+       Christophe Fergeau)
+       
 2004-11-02  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_activate_key_after): As
index ea539e007a14c95dc78f1fed0ff08659ec640c26..61c83ea521978deadc76aecd2b8323e21fdacd74 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-03  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash 
+       if the active_row reference has become invalid.  (#157156,
+       Christophe Fergeau)
+       
 2004-11-02  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_activate_key_after): As
index ea539e007a14c95dc78f1fed0ff08659ec640c26..61c83ea521978deadc76aecd2b8323e21fdacd74 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-03  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash 
+       if the active_row reference has become invalid.  (#157156,
+       Christophe Fergeau)
+       
 2004-11-02  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_activate_key_after): As
index ea539e007a14c95dc78f1fed0ff08659ec640c26..61c83ea521978deadc76aecd2b8323e21fdacd74 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-03  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_get_active): Don't crash 
+       if the active_row reference has become invalid.  (#157156,
+       Christophe Fergeau)
+       
 2004-11-02  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_activate_key_after): As
index aabb3b3c1e8d66679f46c84092718e41e3ca0e26..2b88dc09eaa107ca35159e6599471ca55bef3e38 100644 (file)
@@ -4212,8 +4212,13 @@ gtk_combo_box_get_active (GtkComboBox *combo_box)
     {
       GtkTreePath *path;
       path = gtk_tree_row_reference_get_path (combo_box->priv->active_row);
-      result = gtk_tree_path_get_indices (path)[0];
-      gtk_tree_path_free (path);
+      if (path == NULL)
+       result = -1;
+      else
+       {
+         result = gtk_tree_path_get_indices (path)[0];
+         gtk_tree_path_free (path);
+       }
     }
   else
     result = -1;